<?php
namespace My\Model;

use Utuo\UtuoModel;
class WechatActivityRedPaperModel extends UtuoModel{
	// 状态
	public $status = array(
			0 => '禁止',
			1 => '正常'
	);
	
	// 自动验证
	protected $_validate = array(
			array(
					'name',
					'require',
					'名称不能为空',
					self::MUST_VALIDATE
			)
	);
	
	// 自动完成
	protected $_auto = array(
			array('rule', 'htmlspecialchars_decode', self::MODEL_BOTH, 'function'),
	        array('isMustSubscribe','handleIsMustSubscribe', self::MODEL_BOTH, 'callback'),
	);
	
	protected function handleIsMustSubscribe(){
	    return I('isMustSubscribe',0,'intval');
	}
}
